/*
 * 	This file is a modification of phylip's drawtree.c. It is also part 
 *  of MVD_GUI.
 *
 *  MVD_GUI is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  MVD_GUI is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with MVD_GUI.  If not, see <http://www.gnu.org/licenses/>.
 *  This version copyright 2010 Desmond Schmidt
 */
#ifndef DRAW_H
#define DRAW_H
#define DEFPLOTTER lw
#define pi 3.1415926535897932384626433
typedef enum {lw} plottertype;
typedef enum {penup,pendown} pensttstype;
typedef enum {treepen, labelpen} pentype;
typedef enum {vertical, horizontal} growth;
/* Local variables for plottext: */
struct LOC_plottext 
{              
  double height, compress;
  short *font;
  short coord;
  double heightfont, xfactor, yfactor, xfont, yfont, xplot, yplot, sinslope,
         cosslope, xx, yy;
  pensttstype penstatus;
};
void plot( pensttstype pen, double xabs, double yabs );
void initplotter();
void drawit( char *fontname, double *xoffset, double *yoffset, node *root );
void changepen( pentype pen );
void plottext(char *pstring,int nchars,double height_,double cmpress2,
	double x,double y,double slope,char *fontname);
int rectintersects( double xmin1,double ymin1,double xmax1,double ymax1,
	double xmin2,double ymin2,double xmax2,double ymax2 );
int pointinrect(double x,double y,double x0,double y0,double x1,double y1);
double lengthtext( char *pstring, int nchars, char *fontname );
void metricforfont( char *fontname, short *fontmetric );
void finishplotter();
void plotrparms(int ntips);
double heighttext(char *fontname);
double computeAngle(double oldx, double oldy, double newx, double newy);
#endif
